package com.ego.auth.service;

import com.ego.auth.client.UserClient;
import com.ego.auth.entity.UserInfo;
import com.ego.user.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuthService {

    @Autowired
    private UserClient userClient;


    public UserInfo getUserInfo(String username, String password) {
        User user = userClient.queryUser(username, password).getBody();
        //判断下user有没得
        if (user != null) {
            return new UserInfo(user.getId(), user.getUsername());
        }
        return null;
    }
}
